 $(document).ready(function(){
	 $(".imageupload1").change(function(){
		 var acceptFileTypes = /(gif|jpe?g|png)$/i;
		 var fileName = $(".imageupload1").val();
		 var type = fileName.substring((fileName.lastIndexOf(".")+1),fileName.length);
		 if(!acceptFileTypes.test(type)) {
	 		   layer.msg('文件类型不正确！');
	 		  return false;
	 	  }
		$("#imgupload1").ajaxSubmit({ 
	        url: "userFront/uploadImage",
	        type: "post",
	        success: function (data) {
	        	$(this).unwrap();
	        	if(data != "error"){
				$("#zj_img1").val(data);
				var cc = "/prints/upload/image/"+data;
				var dd ="javaScript:showImg('证件照片','"+cc+"');"
				$("#zj_img11").attr("href",dd);
				$("#zj_img12").attr("src",cc);
	        	}else{
	        		layer.msg('上传失败，请稍后重试！');
	        	}
	        }
	    });
	});
	 $(".imageupload2").change(function(){
		 var acceptFileTypes = /(gif|jpe?g|png)$/i;
		 var fileName = $(".imageupload2").val();
		 var type = fileName.substring((fileName.lastIndexOf(".")+1),fileName.length);
		 if(!acceptFileTypes.test(type)) {
	 		   layer.msg('文件类型不正确！');
	 		  return false;
	 	  }
		$("#imgupload2").ajaxSubmit({ 
	        url: "userFront/uploadImage",
	        type: "post",
	        success: function (data) {
	        	$(this).unwrap();
	        	if(data != "error"){
				$("#zj_img2").val(data);
				var cc = "/prints/upload/image/"+data;
				var dd ="javaScript:showImg('个人头像','"+cc+"');"
				$("#zj_img21").attr("href",dd);
				$("#zj_img22").attr("src",cc);
	        	}else{
	        		layer.msg('上传失败，请稍后重试！');
	        	}
	        }
	    });
	});
 });